home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue39 / slimmer / D2.LOG next >
Encoding:
Text File  |  1998-09-09  |  1.8 KB  |  51 lines

  1. Turbo Debugger Log
  2.  
  3. In D2 the startup code in the EXE file explicitly calls the init-sections
  4.  
  5. of units with explicit init/final code:
  6.  
  7.  
  8. inittest.InitTest: begin
  9.  
  10. :0041F4EC 55             push   ebp
  11. :0041F4ED 8BEC           mov    ebp,esp
  12. :0041F4EF 83C4F4         add    esp,FFFFFFF4
  13. :0041F4F2 E8753CFEFF     call   @InitExe
  14. :0041F4F7 E8904FFEFF     call   System
  15. :0041F4FC E83779FEFF     call   SysUtils
  16. :0041F501 E8C6E4FEFF     call   Classes
  17. :0041F506 E8ADE5FEFF     call   Printers
  18. :0041F50B E80805FFFF     call   Menus
  19. :0041F510 E82367FFFF     call   Controls
  20. :0041F515 E88EFFFFFF     call   Forms
  21. :0041F51A E8ADFFFFFF     call   TestInit
  22. inittest.10:  Application.Initialize;
  23. :0041F51F A128164200     mov    eax,[00421628]
  24. :0041F524 E877F6FFFF     call   TApplication.Initializ
  25.  
  26. In D2 the init code starts with a call to AddExitProc if the unit contains
  27. a finalization section. Otherwise on magic code is added.
  28.  
  29. TestInit: initialization
  30. :0041F4CC B8B0054200     mov    eax,004205B0
  31. :0041F4D1 E8D246FEFF     call   @AddExitProc
  32. testinit.19:  AutoGlobalP := pointer(longint(@UnitGlob
  33. :0041F4D6 B860164200     mov    eax,00421660
  34. :0041F4DB 83C004         add    eax,00000004
  35. :0041F4DE A35C164200     mov    [0042165C],eax
  36. testinit.20:  UnitGlobal := 0;
  37. :0041F4E3 33C0           xor    eax,eax
  38. :0041F4E5 A360164200     mov    [00421660],eax
  39. testinit.22: finalization
  40. :0041F4EA C3             ret
  41.  
  42. No magic code is added to the final section in D2:
  43.  
  44. testinit.finalization:  AutoGlobalP := pointer(longint
  45. :0041F4B4 B860164200     mov    eax,00421660
  46. :0041F4B9 83C004         add    eax,00000004
  47. :0041F4BC A35C164200     mov    [0042165C],eax
  48. testinit.28:  UnitGlobal := 0;
  49. :0041F4C1 33C0           xor    eax,eax
  50. :0041F4C3 A360164200     mov    [00421660],eax
  51. testinit.31: end.
  52. :0041F4C8 C3             ret
  53.  
  54.